import 'dart:convert';

import 'package:x3_base_core/x3_base_core.dart';

/// author：william on 2021/4/1 12:25
/// email：362661044@qq.com

class VipSelectModel extends BaseKeyValueModel {
  VipSelectModel({
    this.vipAvatarUrl,
    this.vipName,
    this.vipId,
    this.gradeId,
    this.gradeName,
    this.vipMobile,
    this.vipBirthDate,
    this.vipScore,
  }) : super(key: vipId, value: vipName);

  factory VipSelectModel.fromJson(Map<String, dynamic> jsonRes) => jsonRes == null
      ? null
      : VipSelectModel(
          vipAvatarUrl: asT<String>(jsonRes['vipAvatarUrl']),
          vipName: asT<String>(jsonRes['vipName']),
          vipId: asT<String>(jsonRes['vipId']),
          gradeId: asT<String>(jsonRes['gradeId']),
          gradeName: asT<String>(jsonRes['gradeName']),
          vipMobile: asT<String>(jsonRes['vipMobile']),
          vipBirthDate: asT<String>(jsonRes['vipBirthDate']),
          vipScore: asT<double>(jsonRes['vipScore']),
        );

  String vipAvatarUrl;
  String vipName;
  String vipId;
  String gradeId;
  String gradeName;
  String vipMobile;
  String vipBirthDate;
  double vipScore;

  Map<String, dynamic> toJson() => <String, dynamic>{
        'vipAvatarUrl': vipAvatarUrl,
        'vipName': vipName,
        'vipId': vipId,
        'gradeId': gradeId,
        'gradeName': gradeName,
        'vipMobile': vipMobile,
        'vipBirthDate': vipBirthDate,
        'vipScore': vipScore,
      };
  @override
  String toString() {
    return json.encode(this);
  }
}
